//
//  BIZRapidConsultCell.m
//  biz
//
//  Created by 边文辉 on 2017/3/20.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "BIZRapidConsultCell.h"
#import "BIZQuestionModel.h"

@interface BIZRapidConsultCell ()

@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;

@property (weak, nonatomic) IBOutlet UIView *redView;

@end


@implementation BIZRapidConsultCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
   
}


-(void)setQuestionModel:(BIZQuestionModel *)questionModel
{
        _questionModel = questionModel;
    
        _contentLabel.text = questionModel.content;
        _dateLabel.text = [NSDate stringFromTimestamp:questionModel.updateTime];
    
    
    if ([questionModel.status integerValue] == 1) {
        self.statusLabel.backgroundColor = HEXCOLOR(0x2daee5);
        self.statusLabel.text = @"已采纳";
    } else if ([questionModel.status integerValue] == 4){
        self.statusLabel.backgroundColor = HEXCOLOR(0xff0000);
        self.statusLabel.text = @"已过期";
    }
    else {
        self.statusLabel.backgroundColor = HEXCOLOR(0xf79e06);
        self.statusLabel.text = @"未采纳";
    }
    
    if ([questionModel.status integerValue] == 2) {
        self.redView.hidden = NO;
    }
    else {
        self.redView.hidden = YES;
    }
 
}


@end
